{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://www.bilibili.com/video/BV1Ct411H7rm?p=2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    }
   ],
   "source": [
    "import keras\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "# Sequential按顺序构成的模型\n",
    "from keras.models import Sequential\n",
    "# Dense全连接层\n",
    "from keras.layers import Dense"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3X+QHGd95/H3x6uVWeGAnFi5ilc2UoKwMYRCYTFOXMFnY2MFVyQncEGADvvinBPAV8EOqogyhzlTVBSrclRS5zqsJC6OkET+AVE2ZzuLDyvH4UI5rW5lHMkoCAPyrii8OZBTPilmJX/vj5mVR6OemZ6Z7pme6c+rylU7PU/PPs/a/nbP9/k+TysiMDOzcjir3x0wM7PecdA3MysRB30zsxJx0DczKxEHfTOzEnHQNzMrEQd9M7MSSRX0Ja2TdFDSIUlbEt7/LUlPSton6auSLqkev0bS3up7eyVdlfUAzMwsPbVanCVpBPhH4BpgFtgDvCciDtS0eUVE/HP15/XAByNinaS1wPcj4oik1wNTETGe01jMzKyFJSnaXAocioinASTtADYAp4L+YsCvejkQ1eMzNcf3Ay+TdHZEvNDol5133nmxatWq1AMwMzPYu3fvP0XEilbt0gT9ceCZmtezwFvqG0n6EHAbsBRISuO8E5hpFvABVq1axfT0dIpumZnZIknfTdMuTU5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EUDAZcDfZ/F7B+1O/1LgUEQ8HRE/AnYAG+rabAD+W/XnB4G3SVIP+5i1lmOOiF0Rcaz6cjewssd9zEOaf9cAnwTuAv6ll53LSZox/3vg7oj4IUBEPNvjPuYhzbgDeEX151cCR3rYv1xExFeAHzRpsgH4XFTsBpZL+qluf++gBf1x4Jma17PVY4ltIuIE8BzwEz3pXT7SjLnWTVTuDgZdy3FLWgtcEBH/vZcdy1Gaf9evAV4j6XFJuyWt61nv8pNm3J8ANkmaBR4G/kNvutZX7f6/n8qSbj+gx5Lu2OvLj9K0GSSpxyNpEzABXJFrj3qj6bglnQV8GrixVx3qgTT/rpdQSfH8ayrf6P6XpNdHxNGc+5anNON+D/DZiPgDST8P/Fl13C/m372+ySWWDdqd/ixwQc3rlZz5Ne9UG0lLqHwVbPYVqujSjBlJVwO3A+sj4oUe9S1Prcb9Y8Drgb+T9B0qOc/JAZ/MTfvf919HxEJEfBs4SOUiMMjSjPsm4H6AiPga8DIq+9MMs1T/77dr0IL+HmCNpNWSllKZqJ2sazMJ3FD9+V3AY1GdFRlQLcdcTXPcQyXgD0OOF1qMOyKei4jzImJVRKyiMpexPiKm+9PdTKT573snlYl7JJ1HJd2D1BvHAAAA4ElEQVTzdE97mb004z4MvA1A0mupBP35nvay9yaB91ereC4DnouI73X7oQOV3omIE5JuAaaozPjfGxH7Jd0JTEfEJPCnVL76HaJyh7+xfz3uXsoxbwPOAR6ozlkfjoj1fet0BlKOe6ikHPMU8HZJB4CTwOaI+L/963X3Uo77d4A/lnQrlRTHjQN+M4ekv6SSpjuvOldxBzAKEBGfoTJ38Q7gEHAM+HeZ/N4B/7uZmVkbBi29Y2ZmXXDQNzMrEQd9M7MScdA3MysRB30zsxJx0DczKxEHfTOzEnHQNzMrkf8PDVSH3mmHKVcAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2caa64d8898>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 使用numpy生成100个随机点\n",
    "x_data=np.random.rand(100)\n",
    "noise=np.random.normal(0,0.01,x_data.shape)\n",
    "y_data=x_data*0.1+0.2+noise\n",
    "\n",
    "#显示随机点\n",
    "plt.scatter(x_data,y_data)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# shift+2个tab键"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 构建一个顺序模型\n",
    "model=Sequential()\n",
    "# 在模型中加一个全连接层\n",
    "model.add(Dense(units=1,input_dim=1))\n",
    "# sgd 随机梯度下降法\n",
    "# mse 均方误差\n",
    "model.compile(optimizer='sgd',loss='mse')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "cost 9.264184e-05\n",
      "cost 9.1614194e-05\n",
      "cost 9.135142e-05\n",
      "cost 9.1284215e-05\n",
      "cost 9.126705e-05\n",
      "cost 9.126265e-05\n",
      "cost 9.126153e-05\n",
      "W [[0.09749158]] b [0.20141926]\n"
     ]
    }
   ],
   "source": [
    "# 训练30001个批次\n",
    "for step in range(3001):\n",
    "    # 每次训练一个批次\n",
    "    cost=model.train_on_batch(x_data,y_data)\n",
    "    # 每500个打印一次batch\n",
    "    if step%500==0:\n",
    "        print('cost',cost)\n",
    "# 打印权值与偏置值\n",
    "W,b=model.layers[0].get_weights()\n",
    "print('W',W,'b',b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIAB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cDvwmy/6LgeWAAWcBv4rjc+ttpH8GsMXdt7r7X4ElwMy0NjOBbyR//j5wnplZBfsYt7zn7O6r3f2l5Mu1QGeF+1gOIX/XAJ8B7gD+p5KdK5OQc/4gcJe7/wnA3V+ocB/LIeS8HXhZ8uejgR0V7F9ZuPsvgD/maDIT+KYnrAXazexVpX5uvQX9DuDZyOuB5LaMbdx9L/Ai8IqK9K48Qs456hoSo4N6l/e8zWwKMN7dl1WyY2UU8nd9AnCCma0xs7VmNr1ivSufkPP+NDDHzAaAB4F/qEzXqqrQ//tBxpT6BhWWacSeXn4U0qaeBJ+Pmc0BuoBzytqjysh53mZ2CPB54OpKdagCQv6ux5BI8fwtiSu6/zKzU9x9Z5n7Vk4h530l8HV3/5yZvQX4VvK895e/e1VTllhWbyP9AWB85HUnoy/zRtqY2RgSl4K5LqFqXcg5Y2bnAzcCM9x9T4X6Vk75zvso4BTgP8zsaRI5z946v5kb+u/7x+4+7O7bgM0kvgTqWch5XwPcB+DuvwQOIzE/TSML+r9fqHoL+uuAyWY2yczGkrhR25vWphe4Kvnz5cAqT94VqVN5zzmZ5ribRMBvhBwv5Dlvd3/R3Y9194nuPpHEvYwZ7t5Xne7GIuTfdw+JG/eY2bEk0j1bK9rL+IWc93bgPAAzez2JoD9U0V5WXi/wvmQVz1nAi+7+XKlvWlfpHXffa2bzgBUk7vjf6+4bzewWoM/de4F/J3Hpt4XECH929XpcusBzXgQcCdyfvGe93d1nVK3TMQg874YSeM4rgAvNbBOwD5jv7v+ver0uXeB5fwL4mpldRyLFcXWdD+Yws++RSNMdm7xXcTPQCuDuXyVx7+JiYAvwEvD+WD63zn9vIiJSgHpL74iISAkU9EVEmoiCvohIE1HQFxFpIgr6IiJNREFfRKSJKOiLiDQRBX0RkSby/wEYh0CQqLASoQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2caaa1d5a58>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 输入网络\n",
    "y_pred=model.predict(x_data)\n",
    "\n",
    "#显示随机点\n",
    "plt.scatter(x_data,y_data)\n",
    "\n",
    "# plt.scatter(x_data,y_pred,'r-',lw=3)\n",
    "# plt.show()\n",
    "plt.plot(x_data,y_pred,'r-',lw=3)\n",
    "plt.show()\n",
    "\n",
    "# plt.show()\n",
    "# plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD9CAYAAABQvqc9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAHHBJREFUeJzt3X+Q3PV93/Hn61YrOEHsU2rcCSedrY5lbDAYJRtQ4gmkGIxMxhIh2BKgGhpSNdjqTEuqGVFUg7FrHG6ok0zVBMVhEsc2P8Tg61FDrxSTpmYsqlMPcTkxF8vElu7kMaRGzmBd4STe/WN35a9We7ffvdu9vd3v6zHDePf7/ezq87FuXvre5/P5vr+KCMzMLBu6Wt0BMzNbOA59M7MMceibmWWIQ9/MLEMc+mZmGeLQNzPLkFShL2mdpHFJByVtr3L+dyWNSnpB0rclnV86fpWkfaVz+yRd0egBmJlZeqq1T19SDvhb4CpgAtgL3BARBxJt3hYR/1B6vR74VESsk7QG+FFEHJH0AWAoInqbNBYzM6shzZX+JcDBiHg5It4EHgY2JBuUA7/kLCBKx0ci4kjp+BhwpqQz5t9tMzObiyUp2vQChxPvJ4BLKxtJ+jRwO7AUqDaN81vASES8MYd+mplZA6QJfVU5dtqcUETsBHZKuhHYAdx88gukC4DfBz5S9Q+QtgBbAM4666xfet/73peiW2ZmVrZv376/j4hzarVLE/oTwMrE+xXAkRnaQnH654/LbyStAL4BfDIivlftAxGxC9gFUCgUYnh4OEW3zMysTNIP0rR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KQwwCN5deXw98K0qrJW2o5nhLUx0PUAz8dp7rLZt1zBHxk4h4R0S8OyLeTXEdY31EDLemu/OW5md6gOKCPZLeQXG65+UF7WXjpBnvIeDDAJLeTzH0X13QXi6sQeCTpV08a4GfRMQPG/kHtO30TkQcl1QuD5EDHoxSeQhgOCIGgT+j+OvgQYpX+Jta1+P5STnefuBsYHdpvfpQRKxvWafnKeWYO0bK8Q4BH5F0ADgBbIuI/9u6Xs9dyvH+HvCnkv4NxWmOW9r4wg1JD1GcmntHaZ3iLorPGSEi/oTiusU1wEHgGPDPG96HNv7/z8zM6tTO0ztmZlYnh76ZWYY49M3MMsShb2aWIQ59M7MMceibmWWIQ9/MLEMc+mZmGfL/AY5S8vHBfGYvAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2caaa77f9e8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "cost 0.118481524\n",
      "cost 0.00038707673\n",
      "cost 0.0001048563\n",
      "cost 2.8404833e-05\n",
      "cost 7.694679e-06\n",
      "cost 2.0844336e-06\n",
      "cost 5.6466723e-07\n",
      "W [[0.09740344]] b [0.20137404]\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD9CAYAAABQvqc9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAH7FJREFUeJzt3XuUVNWZ9/HvQ9NggzEQNZPQgBBDjDcUUoqJE0kUA96gNRpvjBp18Mb7JsEhYCSCyHiBMWpmmCgak9GoeImWLUpY6GtuJhgaGyVgiAgEuknUjJKMgUFonvePqiKHoqja3V3V3VXn91nLteqc85zqfdLkx2afffYxd0dEROKhW2c3QEREOo5CX0QkRhT6IiIxot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0nAMOB3+7l+KnAQlLPRx0HvFzsNpRzT3/X8hDu/gGQWR4iahzwX+nPTwAnlfGCbwWv191fdPct6c0l5Li5XmZCfscANwGzgf/tyMaVQMj1/jMw193fA3D3tzu4jcUUcr0O7Jf+/GHCnxHqkjz1YOq7eUrGAQ94yhKgj5l9vJhtKOfQD1keYleNp6ae/gXYv0NaV3ytXQ7jMlI9hnJW8JrNbBgwwN0XdGTDSiTkd/wp4FNm9pKZLTGzMR3WuuILud4ZwPj0lPDngP/TMU3rNG1e9iZU0JTNLipkeYg2LyHRBQVfi5mNBxKU/4qmea/ZzLoBd5Ba4bUShPyOu5Ma4vkCqX/J/cLMjnD3zSVuWymEXO/5wA/d/XYz+yzwYPp6sxd3rBQlz6xy7umHLA+xq8bMupP652G+f1p1ZUHLYZjZKOB6YKy7b+ugtpVKoWv+EKklu39qZutJjYHWl/HN3NA/00+7+3Z3XwesJvWXQDkKud7LgMdg1wKO+5Bap6ZStWfZmyDlHPohy0PUAxenP58N/D9P3y0pQwWvNz3UcQ+pwC/nsd6MvNfs7n9x9wPcfZC7DyJ1H2Osuzd0TnPbLeTPdJLUDXvM7ABSwz1rO7SVxRNyvRuAkwDM7FBSof9Oh7ayY9UDF6Vn8RwH/MXd/1jMH1C2wzvuvsPMMstDVAH3e3p5CKDB3euB75P65+AaUj388zqvxe0TeL1zgH2Bx9P3qze4+9hOa3Q7BV5zxQi83kXAl8xsFdACTHb3/+68Vrdd4PVeC9xrZt8gNcxxSRl33DCzR0gNzR2Qvk8xndR7RnD3u0ndtzgVWANsAb5a9DaU8f9+IiLSSuU8vCMiIq2k0BcRiRGFvohIjCj0RURiRKEvIhIjCn0RkRhR6IuIxIhCX0QkRv4/vWnWDxMovHUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2caaa75ddd8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import keras\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "# Sequential按顺序构成的模型\n",
    "from keras.models import Sequential\n",
    "# Dense全连接层\n",
    "from keras.layers import Dense\n",
    "\n",
    "# 使用numpy生成100个随机点\n",
    "x_data=np.random.rand(100)\n",
    "noise=np.random.normal(0,0.01,x_data.shape)\n",
    "y_data=x_data*0.1+0.2\n",
    "\n",
    "#显示随机点\n",
    "plt.scatter(x_data,y_data)\n",
    "plt.show()\n",
    "\n",
    "# 构建一个顺序模型\n",
    "model=Sequential()\n",
    "# 在模型中加一个全连接层\n",
    "model.add(Dense(units=1,input_dim=1))\n",
    "# sgd 随机梯度下降法\n",
    "# mse 均方误差\n",
    "model.compile(optimizer='sgd',loss='mse')\n",
    "\n",
    "# 训练30001个批次\n",
    "for step in range(3001):\n",
    "    # 每次训练一个批次\n",
    "    cost=model.train_on_batch(x_data,y_data)\n",
    "    # 每500个打印一次batch\n",
    "    if step%500==0:\n",
    "        print('cost',cost)\n",
    "# 打印权值与偏置值\n",
    "W,b=model.layers[0].get_weights()\n",
    "print('W',W,'b',b)\n",
    "\n",
    "# 输入网络\n",
    "y_pred=model.predict(x_data)\n",
    "\n",
    "#显示随机点\n",
    "plt.scatter(x_data,y_data)\n",
    "\n",
    "# plt.scatter(x_data,y_pred,'r-',lw=3)\n",
    "# plt.show()\n",
    "plt.plot(x_data,y_pred,'r-',lw=3)\n",
    "plt.show()\n",
    "\n",
    "# plt.show()\n",
    "# plt.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "100"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(y_pred)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "100"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(x_data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAFcxJREFUeJzt3X2QXfVdx/H3twmB0bRAZbElIYRqmCGttLTXUOlQtEUbcAx17NigaLGMGUpjHbFqKjp06DijZGofpjiSPtk6WgpUbVrBwKRo1SE1m6FSk4DEiE2IQ9IiT0ObB/brH/emvSx7zz27ex/Peb9mmNlzz+/u/s5m8+GT3z33t5GZSJLq4UXDnoAkaXAMfUmqEUNfkmrE0JekGjH0JalGDH1JqhFDX5JqxNCXpBox9CWpRhYOewLTnXbaabl8+fJhT0OSxsqOHTu+lZkT3caVCv2IWA18BFgAfCIz/3ja+WuAdwPPAc8A6zJzV+vc+4CrW+fek5lbir7W8uXLmZycLDMtSVJLRPxPmXFdl3ciYgFwM3ApsBK4IiJWThv215n5Y5n5GuAm4E9bz10JrAVeCawG/qz1+SRJQ1BmTX8VsCcz92bmEeBW4PL2AZn5VNvhDwLHd3G7HLg1Mw9n5n8De1qfT5I0BGWWd5YA+9qO9wMXTB8UEe8GrgMWAW9qe+62ac9dMqeZSpLmrUzTjxkee8F+zJl5c2b+CPB7wB/M5rkRsS4iJiNi8tChQyWmJEmaizKhvx84s+14KXCgYPytwFtn89zM3JSZjcxsTEx0ffFZkjRHZUJ/O7AiIs6OiEU0X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VjjM1nS+txV3jtmflkZp6WmcszcznN1zPWZObkcKbbU2V+3v+O5ov4RMRpNJd79g50lv1R5tq/CbwZICLOpRn6hwY6y+HYDPxq6y6e1wNPZub/zuUTjfzyTpbb2vmTNP+Zt4dmw187vBn3RsnrnnFL66FNukdKXnsllbz247+nYhfwHPA7mfnt4c26N0pe+28DH4+I36K5vHFVBQoeEfE5mst1p7Ver7gBOAEgM/+c5usXlwF7gGeBX5vz16rA90uSVNI4LO9IknrE0JekGjH0JalGDH1JqhFDX5JqxNCXpBox9CWpRgx9SaqR/wd7JQs5GfABRgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2caa8938c50>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import keras as kr\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2.1.0'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kr.__version__"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Looking in indexes: http://mirrors.aliyun.com/pypi/simple/\n",
      "Collecting keras==2.3.1\n",
      "  Downloading http://mirrors.aliyun.com/pypi/packages/ad/fd/6bfe87920d7f4fd475acd28500a42482b6b84479832bdc0fe9e589a60ceb/Keras-2.3.1-py2.py3-none-any.whl (377 kB)\n",
      "Requirement already satisfied: scipy>=0.14 in c:\\anaconda\\lib\\site-packages (from keras==2.3.1) (1.4.1)\n",
      "Requirement already satisfied: numpy>=1.9.1 in c:\\anaconda\\lib\\site-packages (from keras==2.3.1) (1.18.0)\n",
      "Requirement already satisfied: keras-applications>=1.0.6 in c:\\anaconda\\lib\\site-packages (from keras==2.3.1) (1.0.8)\n",
      "Requirement already satisfied: keras-preprocessing>=1.0.5 in c:\\anaconda\\lib\\site-packages (from keras==2.3.1) (1.1.0)\n",
      "Requirement already satisfied: six>=1.9.0 in c:\\anaconda\\lib\\site-packages (from keras==2.3.1) (1.12.0)\n",
      "Requirement already satisfied: h5py in c:\\anaconda\\lib\\site-packages (from keras==2.3.1) (2.10.0)\n",
      "Requirement already satisfied: pyyaml in c:\\anaconda\\lib\\site-packages (from keras==2.3.1) (3.12)\n",
      "Installing collected packages: keras\n",
      "  Attempting uninstall: keras\n",
      "    Found existing installation: Keras 2.1.0\n",
      "    Uninstalling Keras-2.1.0:\n",
      "      Successfully uninstalled Keras-2.1.0\n",
      "Successfully installed keras-2.3.1\n"
     ]
    }
   ],
   "source": [
    "!pip install keras==2.3.1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
